import {Navigate, Route,Routes} from 'react-router-dom'
import Film from '../views/Films'
import NowPlaying from '../views/Films/NowPlaying'
import ComingSoon from '../views/Films/ComingSoon'
import Cinema from '../views/Cinema'
import Search from '../views/Search'
import Center from '../views/Center'
import NotFound from '../views/NotFound'
export default function MRouter(){
    return  <Routes>
        {/* <Route path='/' element={<Film/>}></Route> */}
        {/* <Route index element={<Film/>}></Route>  */}
        <Route path='/film' element={<Film/>}>
            {/* 只匹配到父路径时加载 */}
            {/* <Route index element={<NowPlaying/>}></Route> */}
            <Route path='' element={<Navigate to="/film/nowplaying"/>}></Route>
            <Route path='nowplaying' element={<NowPlaying/>}></Route>
            <Route path='comingsoon' element={<ComingSoon/>}></Route>
        </Route>
        <Route path='/cinema' element={<Cinema/>}></Route>
        <Route path='/cinema/search' element={<Search/>}></Route>
        <Route path='/center' element={<Center/>}></Route>
        <Route path='/' element={<Navigate to="/film"/>}></Route>
        <Route path='*' element={<NotFound/>}></Route>
    </Routes>
}